package com.qdxwx.data.service.manager;

import com.qdxwx.common.page.PageRequest;
import com.qdxwx.common.utils.TKConvert;
import com.qdxwx.data.mapper.manager.ManagerLoginMapper;
import com.qdxwx.models.manager.ManagerLogin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 系统访问日志情况信息 服务层处理
 * Qdx NetSchool Platform
 * @author qdxwx
 * @updateTime 2022/5/25
 * @description
 */
@Service
public class ManagerLoginServiceImpl implements ManagerLoginService
{

    @Autowired
    private ManagerLoginMapper managerLoginMapper;

    @Override
    public void insert(ManagerLogin managerLogin)
    {
        managerLogin.setLoginTime(LocalDateTime.now());
        managerLoginMapper.insertManagerLogin(managerLogin);
    }

    @Override
    public List<ManagerLogin> getList(ManagerLogin managerLogin, PageRequest page)
    {
        return managerLoginMapper.selectList(managerLogin,page);
    }

    @Override
    public long count(ManagerLogin managerLogin)
    {
        return managerLoginMapper.selectCount(managerLogin);
    }

    @Override
    public int deleteByIds(String ids)
    {
        return managerLoginMapper.deleteManagerLoginByIds(TKConvert.toStrArray(ids));
    }

    @Override
    public void clean()
    {
        managerLoginMapper.cleanManagerLogin();
    }
}
